class Food {
    element: HTMLSelectElement;
    constructor() {
        this.element = document.querySelector(".food")!;
    }
    get X():number{
        return this.element.offsetLeft;
    }
    // 获取食物Y坐标
    get Y():number{
        return this.element.offsetTop;
    }

    setPosition(){
        this.element.style.left = Math.floor(Math.random()*30)*10+'px';
        this.element.style.top = Math.floor(Math.random()*32)*10+'px';
        // console.log(this.element.style.left,this.element.style.top)
    }
}

export default Food;